#ifndef LegoDescription_h
#define LegoDescription_h

#include <vector>

#include <Wt/WColor>

struct LegoDescription
{
public:

  enum LegoColor
  {
    kGreen, kYellow, kBlue, kRed, kGrey, kWhite, kNumLegoColors
  };//enum LegoColor

  enum LegoType
  {
    k1x1, k2x2, k2x4, k4x2, k2x8, k8x2, k1x2, k2x1, k1x4, k4x1, kNumLegoTypes
  };//enum LegoType

  int pos_x;  //in number of lego cells from left hand side
  int pos_y;  //in number of lego cells from top

//  LegoColor color;
  unsigned char color[3];  //r,g,b
  void set_color( LegoColor c );

  LegoType type;

  int nrows() const;
  int ncolomuns() const;

  static int nrows( LegoType type );
  static int ncolomuns( LegoType type );

  Wt::WColor penColor() const;
  Wt::WColor fillColor() const;
};//struct LegoDescription


struct LegoSceneDescription
{
public:
  int scene_width;   //in number of lego cells
  int scene_height;  //in number of lego cells

  int pixels_per_cell;  //number of pixels foreach lego cell

  std::vector<LegoDescription> legos;

  double xStartPosInPixels( const LegoDescription &lego ) const;
  double yStartPosInPixels( const LegoDescription &lego ) const;
  double legoWidthInPixels( const LegoDescription &lego ) const;
  double legoHeightInPixels( const LegoDescription &lego ) const;

  int widthInPixels() const;
  int heightInPixels() const;
};//struct LegoSceneDescription

#endif





